//* TODO: you could rerange any value to -127~127
#include "../1880v2_test_util.h"
#define OUT
#define IN
//#define DBG

/**
 * pre_data means we test fixed pattern, it should be same sa lut
 * compare fix means we MAKE SURE output values equal with golden,
 * comment it for check with error using `MAX_ERROR`
 */
enum TEST_MODE {
  PRE_DATA_COMPARE_FIX = 0,  // pre-data + fix compare
  PRE_DATA_MAX_ERROR,        // pre-data + compare only diff < MAX_ERROR
  GEN_DATA_MAX_ERROR,        // gen data + compare only diff < MAX_ERROR
  TEST_MODE_MAX,
};

static TEST_MODE mode;
#define MAX_ERROR (0.004)

using namespace std;
static u16 test_pattern[] = {
    0x0000, 0x3C03, 0x3C83, 0x3CC5, 0x3D03, 0x3D24, 0x3D45, 0x3D65, 0x3D83,
    0x3D93, 0x3DA4, 0x3DB4, 0x3DC5, 0x3DD5, 0x3DE5, 0x3DF6, 0x3E03, 0x3E0B,
    0x3E13, 0x3E1C, 0x3E24, 0x3E2C, 0x3E34, 0x3E3C, 0x3E45, 0x3E4D, 0x3E55,
    0x3E5D, 0x3E65, 0x3E6E, 0x3E76, 0x3E7E, 0x3E83, 0x3E87, 0x3E8B, 0x3E8F,
    0x3E93, 0x3E98, 0x3E9C, 0x3EA0, 0x3EA4, 0x3EA8, 0x3EAC, 0x3EB0, 0x3EB4,
    0x3EB8, 0x3EBC, 0x3EC1, 0x3EC5, 0x3EC9, 0x3ECD, 0x3ED1, 0x3ED5, 0x3ED9,
    0x3EDD, 0x3EE1, 0x3EE5, 0x3EE9, 0x3EEE, 0x3EF2, 0x3EF6, 0x3EFA, 0x3EFE,
    0x3F01, 0x3F03, 0x3F05, 0x3F07, 0x3F09, 0x3F0B, 0x3F0D, 0x3F0F, 0x3F11,
    0x3F13, 0x3F16, 0x3F18, 0x3F1A, 0x3F1C, 0x3F1E, 0x3F20, 0x3F22, 0x3F24,
    0x3F26, 0x3F28, 0x3F2A, 0x3F2C, 0x3F2E, 0x3F30, 0x3F32, 0x3F34, 0x3F36,
    0x3F38, 0x3F3A, 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x3FE4, 0x3FE5,
    0x3FE6, 0x3FE7, 0x3FE8, 0x3FE9, 0x3FEA, 0x3FEC, 0x3FED, 0x3FEE, 0x3FEF,
    0x3FF0, 0x3FF1, 0x3FF2, 0x3FF3, 0x3FF4, 0x3FF5, 0x3FF6, 0x3FF7, 0x3FF8,
    0x3FF9, 0x3FFA, 0x3FFB, 0x3FFC, 0x3FFD, 0x3FFE, 0x3FFF, 0x4000, 0x4001,
    0x4001, 0x4002, 0x4002, 0x4003, 0x4003, 0x4004, 0x4004, 0x4005, 0x4005,
    0x4006, 0x4006, 0x4007, 0x4007, 0x4008, 0x4008, 0x4009, 0x4009, 0x400A,
    0x400A, 0x400B, 0x400B, 0x400C, 0x400C, 0x400D, 0x400D, 0x400E, 0x400E,
    0x400F, 0x400F, 0x4010, 0x4010, 0x4011, 0x4011, 0x4012, 0x4012, 0x4013,
    0x4013, 0x4014, 0x4014, 0x4015, 0x4016, 0x4016, 0x4017, 0x4017, 0x4018,
    0x4018, 0x4019, 0x4019, 0x401A, 0x401A, 0x401B, 0x401B, 0x401C, 0x401C,
    0x401D, 0x401D, 0x401E, 0x401E, 0x401F, 0x401F, 0x4020, 0x4020, 0x4021,
    0x4021, 0x4022, 0x4022, 0x4023, 0x4023, 0x4024, 0x4024, 0x4025, 0x4025,
    0x4026, 0x4026, 0x4027, 0x4027, 0x4028, 0x4028, 0x4029, 0x4029, 0x402A,
    0x402A, 0x402B, 0x402C, 0x402C, 0x402D, 0x402D, 0x402E, 0x402E, 0x402F,
    0x402F, 0x4030, 0x4030, 0x4031, 0x4031, 0x4032, 0x4032, 0x4033, 0x4033,
    0x4034, 0x4034, 0x4035, 0x4035, 0x4036, 0x4036, 0x4037, 0x4037, 0x4038,
    0x4038, 0x4039, 0x4039, 0x403A, 0x403A, 0x403B, 0x403B, 0x403C, 0x403C,
    0x403D, 0x403D, 0x403E, 0x403E, 0x403F, 0x403F, 0x4040, 0x4041, 0x4041,
    0x4042, 0x4042, 0x4043, 0x4043, 0x4044, 0x4044, 0x4045, 0x4045, 0x4046,
    0x4046, 0x4047, 0x4047, 0x4048, 0x4048, 0x4049, 0x4049, 0x404A, 0x404A,
    0x404B, 0x404B, 0x404C, 0x404C, 0x404D, 0x404D, 0x404E, 0x404E, 0x404F,
    0x404F, 0x4050, 0x4050, 0x4051, 0x4051, 0x4052, 0x4052, 0x4053, 0x4053,
    0x4054, 0x4054, 0x4055, 0x4056, 0x4056, 0x4057, 0x4057, 0x4058, 0x4058,
    0x4059, 0x4059, 0x405A, 0x405A, 0x405B, 0x405B, 0x405C, 0x405C, 0x405D,
    0x405D, 0x405E, 0x405E, 0x405F, 0x405F, 0x4060, 0x4060, 0x4061, 0x4061,
    0x4062, 0x4062, 0x4063, 0x4063, 0x4064, 0x4064, 0x4065, 0x4065, 0x4066,
    0x4066, 0x4067, 0x4067, 0x4068, 0x4068, 0x4069, 0x4069, 0x406A, 0x406A,
    0x406B, 0x406C, 0x406C, 0x406D, 0x406D, 0x406E, 0x406E, 0x406F, 0x406F,
    0x4070, 0x4070, 0x4071, 0x4071, 0x4072, 0x4072, 0x4073, 0x4073, 0x4074,
    0x4074, 0x4075, 0x4075, 0x4076, 0x4076, 0x4077, 0x4077, 0x4078, 0x4078,
    0x4079, 0x4079, 0x407A, 0x407A, 0x407B, 0x407B, 0x407C, 0x407C, 0x407D,
    0x407D, 0x407E, 0x407E, 0x407F, 0x407F, 0x4080, 0x4080, 0x4081, 0x4081,
    0x4081, 0x4081, 0x4082, 0x4082, 0x4082, 0x4082, 0x4083, 0x4083, 0x4083,
    0x4083, 0x4084, 0x4084, 0x4084, 0x4084, 0x4085, 0x4085, 0x4085, 0x4085,
    0x4086, 0x4086, 0x4086, 0x4086, 0x4087, 0x4087, 0x4087, 0x4087, 0x4088,
    0x4088, 0x4088, 0x4088, 0x4089, 0x4089, 0x4089, 0x4089, 0x408A, 0x408A,
    0x408A, 0x408A, 0x408B, 0x408B, 0x408B, 0x408C, 0x408C, 0x408C, 0x408C,
    0x408D, 0x408D, 0x408D, 0x408D, 0x408E, 0x408E, 0x408E, 0x408E, 0x408F,
    0x408F, 0x408F, 0x408F, 0x4090, 0x4090, 0x4090, 0x4090, 0x4091, 0x4091,
    0x4091, 0x4091, 0x4092, 0x4092, 0x4092, 0x4092, 0x4093, 0x4093, 0x4093,
    0x4093, 0x4094, 0x4094, 0x4094, 0x4094, 0x4095, 0x4095, 0x4095, 0x4096,
    0x4096, 0x4096, 0x4096, 0x4097, 0x4097, 0x4097, 0x4097, 0x4098, 0x4098,
    0x4098, 0x4098, 0x4099, 0x4099, 0x4099, 0x4099, 0x409A, 0x409A, 0x409A,
    0x409A, 0x409B, 0x409B, 0x409B, 0x409B, 0x409C, 0x409C, 0x409C, 0x409C,
    0x409D, 0x409D, 0x409D, 0x409D, 0x409E, 0x409E, 0x409E, 0x409E, 0x409F,
    0x409F, 0x409F, 0x409F, 0x40A0, 0x40A0, 0x40A0, 0x40A1, 0x40A1, 0x40A1,
    0x40A1, 0x40A2, 0x40A2, 0x40A2, 0x40A2, 0x40A3, 0x40A3, 0x40A3, 0x40A3,
    0x40A4, 0x40A4, 0x40A4, 0x40A4, 0x40A5, 0x40A5, 0x40A5, 0x40A5, 0x40A6,
    0x40A6, 0x40A6, 0x40A6, 0x40A7, 0x40A7, 0x40A7, 0x40A7, 0x40A8, 0x40A8,
    0x40A8, 0x40A8, 0x40A9, 0x40A9, 0x40A9, 0x40A9, 0x40AA, 0x40AA, 0x40AA,
    0x40AA, 0x40AB, 0x40AB, 0x40AB, 0x40AC, 0x40AC, 0x40AC, 0x40AC, 0x40AD,
    0x40AD, 0x40AD, 0x40AD, 0x40AE, 0x40AE, 0x40AE, 0x40AE, 0x40AF, 0x40AF,
    0x40AF, 0x40AF, 0x40B0, 0x40B0, 0x40B0, 0x40B0, 0x40B1, 0x40B1, 0x40B1,
    0x40B1, 0x40B2, 0x40B2, 0x40B2, 0x40B2, 0x40B3, 0x40B3, 0x40B3, 0x40B3,
    0x40B4, 0x40B4, 0x40B4, 0x40B4, 0x40B5, 0x40B5, 0x40B5, 0x40B6, 0x40B6,
    0x40B6, 0x40B6, 0x40B7, 0x40B7, 0x40B7, 0x40B7, 0x40B8, 0x40B8, 0x40B8,
    0x40B8, 0x40B9, 0x40B9, 0x40B9, 0x40B9, 0x40BA, 0x40BA, 0x40BA, 0x40BA,
    0x40BB, 0x40BB, 0x40BB, 0x40BB, 0x40BC, 0x40BC, 0x40BC, 0x40BC, 0x40BD,
    0x40BD, 0x40BD, 0x40BD, 0x40BE, 0x40BE, 0x40BE, 0x40BE, 0x40BF, 0x40BF,
    0x40BF, 0x40BF, 0x40C0, 0x40C0, 0x40C0, 0x40C1, 0x40C1, 0x40C1, 0x40C1,
    0x40C2, 0x40C2, 0x40C2, 0x40C2, 0x40C3, 0x40C3, 0x40C3, 0x40C3, 0x40C4,
    0x40C4, 0x40C4, 0x40C4, 0x40C5, 0x40C5, 0x40C5, 0x40C5, 0x40C6, 0x40C6,
    0x40C6, 0x40C6, 0x40C7, 0x40C7, 0x40C7, 0x40C7, 0x40C8, 0x40C8, 0x40C8,
    0x40C8, 0x40C9, 0x40C9, 0x40C9, 0x40C9, 0x40CA, 0x40CA, 0x40CA, 0x40CA,
    0x40CB, 0x40CB, 0x40CB, 0x40CC, 0x40CC, 0x40CC, 0x40CC, 0x40CD, 0x40CD,
    0x40CD, 0x40CD, 0x40CE, 0x40CE, 0x40CE, 0x40CE, 0x40CF, 0x40CF, 0x40CF,
    0x40CF, 0x40D0, 0x40D0, 0x40D0, 0x40D0, 0x40D1, 0x40D1, 0x40D1, 0x40D1,
    0x40D2, 0x40D2, 0x40D2, 0x40D2, 0x40D3, 0x40D3, 0x40D3, 0x40D3, 0x40D4,
    0x40D4, 0x40D4, 0x40D4, 0x40D5, 0x40D5, 0x40D5, 0x40D6, 0x40D6, 0x40D6,
    0x40D6, 0x40D7, 0x40D7, 0x40D7, 0x40D7, 0x40D8, 0x40D8, 0x40D8, 0x40D8,
    0x40D9, 0x40D9, 0x40D9, 0x40D9, 0x40DA, 0x40DA, 0x40DA, 0x40DA, 0x40DB,
    0x40DB, 0x40DB, 0x40DB, 0x40DC, 0x40DC, 0x40DC, 0x40DC, 0x40DD, 0x40DD,
    0x40DD, 0x40DD, 0x40DE, 0x40DE, 0x40DE, 0x40DE, 0x40DF, 0x40DF, 0x40DF,
    0x40DF, 0x40E0, 0x40E0, 0x40E0, 0x40E1, 0x40E1, 0x40E1, 0x40E1, 0x40E2,
    0x40E2, 0x40E2, 0x40E2, 0x40E3, 0x40E3, 0x40E3, 0x40E3, 0x40E4, 0x40E4,
    0x40E4, 0x40E4, 0x40E5, 0x40E5, 0x40E5, 0x40E5, 0x40E6, 0x40E6, 0x40E6,
    0x40E6, 0x40E7, 0x40E7, 0x40E7, 0x40E7, 0x40E8, 0x40E8, 0x40E8, 0x40E8,
    0x40E9, 0x40E9, 0x40E9, 0x40E9, 0x40EA, 0x40EA, 0x40EA, 0x40EA, 0x40EB,
    0x40EB, 0x40EB, 0x40EC, 0x40EC, 0x40EC, 0x40EC, 0x40ED, 0x40ED, 0x40ED,
    0x40ED, 0x40EE, 0x40EE, 0x40EE, 0x40EE, 0x40EF, 0x40EF, 0x40EF, 0x40EF,
    0x40F0, 0x40F0, 0x40F0, 0x40F0, 0x40F1, 0x40F1, 0x40F1, 0x40F1, 0x40F2,
    0x40F2, 0x40F2, 0x40F2, 0x40F3, 0x40F3, 0x40F3, 0x40F3, 0x40F4, 0x40F4,
    0x40F4, 0x40F4, 0x40F5, 0x40F5, 0x40F5, 0x40F6, 0x40F6, 0x40F6, 0x40F6,
    0x40F7, 0x40F7, 0x40F7, 0x40F7, 0x40F8, 0x40F8, 0x40F8, 0x40F8, 0x40F9,
    0x40F9, 0x40F9, 0x40F9, 0x40FA, 0x40FA, 0x40FA, 0x40FA, 0x40FB, 0x40FB,
    0x40FB, 0x40FB, 0x40FC, 0x40FC, 0x40FC, 0x40FC, 0x40FD, 0x40FD, 0x40FD,
    0x40FD, 0x40FE, 0x40FE, 0x40FE, 0x40FE, 0x40FF, 0x40FF, 0x40FF, 0x40FF,
    0x4100, 0xBC03, 0xBC83, 0xBCC5, 0xBD03, 0xBD24, 0xBD45, 0xBD65, 0xBD83,
    0xBD93, 0xBDA4, 0xBDB4, 0xBDC5, 0xBDD5, 0xBDE5, 0xBDF6, 0xBE03, 0xBE0B,
    0xBE13, 0xBE1C, 0xBE24, 0xBE2C, 0xBE34, 0xBE3C, 0xBE45, 0xBE4D, 0xBE55,
    0xBE5D, 0xBE65, 0xBE6E, 0xBE76, 0xBE7E, 0xBE83, 0xBE87, 0xBE8B, 0xBE8F,
    0xBE93, 0xBE98, 0xBE9C, 0xBEA0, 0xBEA4, 0xBEA8, 0xBEAC, 0xBEB0, 0xBEB4,
    0xBEB8, 0xBEBC, 0xBEC1, 0xBEC5, 0xBEC9, 0xBECD, 0xBED1, 0xBED5, 0xBED9,
    0xBEDD, 0xBEE1, 0xBEE5, 0xBEE9, 0xBEEE, 0xBEF2, 0xBEF6, 0xBEFA, 0xBEFE,
    0xBF01, 0xBF03, 0xBF05, 0xBF07, 0xBF09, 0xBF0B, 0xBF0D, 0xBF0F, 0xBF11,
    0xBF13, 0xBF16, 0xBF18, 0xBF1A, 0xBF1C, 0xBF1E, 0xBF20, 0xBF22, 0xBF24,
    0xBF26, 0xBF28, 0xBF2A, 0xBF2C, 0xBF2E, 0xBF30, 0xBF32, 0xBF34, 0xBF36,
    0xBF38, 0xBF3A, 0xBF3C, 0xBF3E, 0xBF41, 0xBF43, 0xBF45, 0xBF47, 0xBF49,
    0xBF4B, 0xBF4D, 0xBF4F, 0xBF51, 0xBF53, 0xBF55, 0xBF57, 0xBF59, 0xBF5B,
    0xBF5D, 0xBF5F, 0xBF61, 0xBF63, 0xBF65, 0xBF67, 0xBF69, 0xBF6C, 0xBF6E,
    0xBF70, 0xBF72, 0xBF74, 0xBF76, 0xBF78, 0xBF7A, 0xBF7C, 0xBF7E, 0xBF80,
    0xBF81, 0xBF82, 0xBF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xC005, 0xC005,
    0xC006, 0xC006, 0xC007, 0xC007, 0xC008, 0xC008, 0xC009, 0xC009, 0xC00A,
    0xC00A, 0xC00B, 0xC00B, 0xC00C, 0xC00C, 0xC00D, 0xC00D, 0xC00E, 0xC00E,
    0xC00F, 0xC00F, 0xC010, 0xC010, 0xC011, 0xC011, 0xC012, 0xC012, 0xC013,
    0xC013, 0xC014, 0xC014, 0xC015, 0xC016, 0xC016, 0xC017, 0xC017, 0xC018,
    0xC018, 0xC019, 0xC019, 0xC01A, 0xC01A, 0xC01B, 0xC01B, 0xC01C, 0xC01C,
    0xC01D, 0xC01D, 0xC01E, 0xC01E, 0xC01F, 0xC01F, 0xC020, 0xC020, 0xC021,
    0xC021, 0xC022, 0xC022, 0xC023, 0xC023, 0xC024, 0xC024, 0xC025, 0xC025,
    0xC026, 0xC026, 0xC027, 0xC027, 0xC028, 0xC028, 0xC029, 0xC029, 0xC02A,
    0xC02A, 0xC02B, 0xC02C, 0xC02C, 0xC02D, 0xC02D, 0xC02E, 0xC02E, 0xC02F,
    0xC02F, 0xC030, 0xC030, 0xC031, 0xC031, 0xC032, 0xC032, 0xC033, 0xC033,
    0xC034, 0xC034, 0xC035, 0xC035, 0xC036, 0xC036, 0xC037, 0xC037, 0xC038,
    0xC038, 0xC039, 0xC039, 0xC03A, 0xC03A, 0xC03B, 0xC03B, 0xC03C, 0xC03C,
    0xC03D, 0xC03D, 0xC03E, 0xC03E, 0xC03F, 0xC03F, 0xC040, 0xC041, 0xC041,
    0xC042, 0xC042, 0xC043, 0xC043, 0xC044, 0xC044, 0xC045, 0xC045, 0xC046,
    0xC046, 0xC047, 0xC047, 0xC048, 0xC048, 0xC049, 0xC049, 0xC04A, 0xC04A,
    0xC04B, 0xC04B, 0xC04C, 0xC04C, 0xC04D, 0xC04D, 0xC04E, 0xC04E, 0xC04F,
    0xC04F, 0xC050, 0xC050, 0xC051, 0xC051, 0xC052, 0xC052, 0xC053, 0xC053,
    0xC054, 0xC054, 0xC055, 0xC056, 0xC056, 0xC057, 0xC057, 0xC058, 0xC058,
    0xC059, 0xC059, 0xC05A, 0xC05A, 0xC05B, 0xC05B, 0xC05C, 0xC05C, 0xC05D,
    0xC05D, 0xC05E, 0xC05E, 0xC05F, 0xC05F, 0xC060, 0xC060, 0xC061, 0xC061,
    0xC062, 0xC062, 0xC063, 0xC063, 0xC064, 0xC064, 0xC065, 0xC065, 0xC066,
    0xC066, 0xC067, 0xC067, 0xC068, 0xC068, 0xC069, 0xC069, 0xC06A, 0xC06A,
    0xC06B, 0xC06C, 0xC06C, 0xC06D, 0xC06D, 0xC06E, 0xC06E, 0xC06F, 0xC06F,
    0xC070, 0xC070, 0xC071, 0xC071, 0xC072, 0xC072, 0xC073, 0xC073, 0xC074,
    0xC074, 0xC075, 0xC075, 0xC076, 0xC076, 0xC077, 0xC077, 0xC078, 0xC078,
    0xC079, 0xC079, 0xC07A, 0xC07A, 0xC07B, 0xC07B, 0xC07C, 0xC07C, 0xC07D,
    0xC07D, 0xC07E, 0xC07E, 0xC07F, 0xC07F, 0xC080, 0xC080, 0xC081, 0xC081,
    0xC081, 0xC081, 0xC082, 0xC082, 0xC082, 0xC082, 0xC083, 0xC083, 0xC083,
    0xC083, 0xC084, 0xC084, 0xC084, 0xC084, 0xC085, 0xC085, 0xC085, 0xC085,
    0xC086, 0xC086, 0xC086, 0xC086, 0xC087, 0xC087, 0xC087, 0xC087, 0xC088,
    0xC088, 0xC088, 0xC088, 0xC089, 0xC089, 0xC089, 0xC089, 0xC08A, 0xC08A,
    0xC08A, 0xC08A, 0xC08B, 0xC08B, 0xC08B, 0xC08C, 0xC08C, 0xC08C, 0xC08C,
    0xC08D, 0xC08D, 0xC08D, 0xC08D, 0xC08E, 0xC08E, 0xC08E, 0xC08E, 0xC08F,
    0xC08F, 0xC08F, 0xC08F, 0xC090, 0xC090, 0xC090, 0xC090, 0xC091, 0xC091,
    0xC091, 0xC091, 0xC092, 0xC092, 0xC092, 0xC092, 0xC093, 0xC093, 0xC093,
    0xC093, 0xC094, 0xC094, 0xC094, 0xC094, 0xC095, 0xC095, 0xC095, 0xC096,
    0xC096, 0xC096, 0xC096, 0xC097, 0xC097, 0xC097, 0xC097, 0xC098, 0xC098,
    0xC098, 0xC098, 0xC099, 0xC099, 0xC099, 0xC099, 0xC09A, 0xC09A, 0xC09A,
    0xC09A, 0xC09B, 0xC09B, 0xC09B, 0xC09B, 0xC09C, 0xC09C, 0xC09C, 0xC09C,
    0xC09D, 0xC09D, 0xC09D, 0xC09D, 0xC09E, 0xC09E, 0xC09E, 0xC09E, 0xC09F,
    0xC09F, 0xC09F, 0xC09F, 0xC0A0, 0xC0A0, 0xC0A0, 0xC0A1, 0xC0A1, 0xC0A1,
    0xC0A1, 0xC0A2, 0xC0A2, 0xC0A2, 0xC0A2, 0xC0A3, 0xC0A3, 0xC0A3, 0xC0A3,
    0xC0A4, 0xC0A4, 0xC0A4, 0xC0A4, 0xC0A5, 0xC0A5, 0xC0A5, 0xC0A5, 0xC0A6,
    0xC0A6, 0xC0A6, 0xC0A6, 0xC0A7, 0xC0A7, 0xC0A7, 0xC0A7, 0xC0A8, 0xC0A8,
    0xC0A8, 0xC0A8, 0xC0A9, 0xC0A9, 0xC0A9, 0xC0A9, 0xC0AA, 0xC0AA, 0xC0AA,
    0xC0AA, 0xC0AB, 0xC0AB, 0xC0AB, 0xC0AC, 0xC0AC, 0xC0AC, 0xC0AC, 0xC0AD,
    0xC0AD, 0xC0AD, 0xC0AD, 0xC0AE, 0xC0AE, 0xC0AE, 0xC0AE, 0xC0AF, 0xC0AF,
    0xC0AF, 0xC0AF, 0xC0B0, 0xC0B0, 0xC0B0, 0xC0B0, 0xC0B1, 0xC0B1, 0xC0B1,
    0xC0B1, 0xC0B2, 0xC0B2, 0xC0B2, 0xC0B2, 0xC0B3, 0xC0B3, 0xC0B3, 0xC0B3,
    0xC0B4, 0xC0B4, 0xC0B4, 0xC0B4, 0xC0B5, 0xC0B5, 0xC0B5, 0xC0B6, 0xC0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    0xC0F7, 0xC0F7, 0xC0F7, 0xC0F7, 0xC0F8, 0xC0F8, 0xC0F8, 0xC0F8, 0xC0F9,
    0xC0F9, 0xC0F9, 0xC0F9, 0xC0FA, 0xC0FA, 0xC0FA, 0xC0FA, 0xC0FB, 0xC0FB,
    0xC0FB, 0xC0FB, 0xC0FC, 0xC0FC, 0xC0FC, 0xC0FC, 0xC0FD, 0xC0FD, 0xC0FD,
    0xC0FD, 0xC0FE, 0xC0FE, 0xC0FE, 0xC0FE, 0xC0FF, 0xC0FF, 0xC0FF, 0xC0FF,
    0xC100, 0xC100,
};

static u16 sigmode_golden_bf16[] = {
    0x3f00, 0x3f01, 0x3f01, 0x3f02, 0x3f02, 0x3f03, 0x3f03, 0x3f04, 0x3f04,
    0x3f05, 0x3f05, 0x3f06, 0x3f06, 0x3f07, 0x3f07, 0x3f08, 0x3f08, 0x3f09,
    0x3f09, 0x3f0a, 0x3f0a, 0x3f0b, 0x3f0b, 0x3f0c, 0x3f0c, 0x3f0d, 0x3f0d,
    0x3f0e, 0x3f0e, 0x3f0f, 0x3f0f, 0x3f10, 0x3f10, 0x3f11, 0x3f11, 0x3f12,
    0x3f12, 0x3f13, 0x3f13, 0x3f14, 0x3f14, 0x3f15, 0x3f15, 0x3f16, 0x3f16,
    0x3f17, 0x3f17, 0x3f18, 0x3f19, 0x3f19, 0x3f1a, 0x3f1a, 0x3f1b, 0x3f1b,
    0x3f1b, 0x3f1c, 0x3f1d, 0x3f1d, 0x3f1e, 0x3f1e, 0x3f1f, 0x3f1f, 0x3f20,
    0x3f1f, 0x3f20, 0x3f20, 0x3f21, 0x3f21, 0x3f22, 0x3f22, 0x3f23, 0x3f23,
    0x3f24, 0x3f24, 0x3f25, 0x3f25, 0x3f26, 0x3f26, 0x3f27, 0x3f27, 0x3f28,
    0x3f28, 0x3f29, 0x3f29, 0x3f2a, 0x3f2a, 0x3f2a, 0x3f2a, 0x3f2b, 0x3f2b,
    0x3f2c, 0x3f2c, 0x3f2d, 0x3f2d, 0x3f2e, 0x3f2f, 0x3f2f, 0x3f30, 0x3f30,
    0x3f30, 0x3f31, 0x3f31, 0x3f31, 0x3f32, 0x3f32, 0x3f32, 0x3f33, 0x3f33,
    0x3f34, 0x3f34, 0x3f35, 0x3f36, 0x3f36, 0x3f36, 0x3f37, 0x3f37, 0x3f38,
    0x3f38, 0x3f38, 0x3f39, 0x3f39, 0x3f3a, 0x3f3a, 0x3f3a, 0x3f3b, 0x3f3b,
    0x3f3b, 0x3f3c, 0x3f3c, 0x3f3d, 0x3f3d, 0x3f3d, 0x3f3e, 0x3f3e, 0x3f3e,
    0x3f3f, 0x3f3f, 0x3f40, 0x3f40, 0x3f40, 0x3f41, 0x3f41, 0x3f41, 0x3f42,
    0x3f42, 0x3f42, 0x3f43, 0x3f44, 0x3f44, 0x3f44, 0x3f45, 0x3f45, 0x3f45,
    0x3f46, 0x3f46, 0x3f46, 0x3f47, 0x3f47, 0x3f48, 0x3f48, 0x3f48, 0x3f49,
    0x3f49, 0x3f49, 0x3f4a, 0x3f4a, 0x3f4b, 0x3f4b, 0x3f4b, 0x3f4c, 0x3f4c,
    0x3f4c, 0x3f4c, 0x3f4c, 0x3f4d, 0x3f4d, 0x3f4d, 0x3f4e, 0x3f4e, 0x3f4e,
    0x3f4f, 0x3f4f, 0x3f50, 0x3f50, 0x3f50, 0x3f51, 0x3f51, 0x3f51, 0x3f51,
    0x3f52, 0x3f52, 0x3f52, 0x3f52, 0x3f53, 0x3f53, 0x3f54, 0x3f54, 0x3f55,
    0x3f55, 0x3f55, 0x3f55, 0x3f56, 0x3f56, 0x3f56, 0x3f56, 0x3f57, 0x3f57,
    0x3f57, 0x3f57, 0x3f58, 0x3f58, 0x3f58, 0x3f58, 0x3f59, 0x3f59, 0x3f59,
    0x3f59, 0x3f5a, 0x3f5a, 0x3f5a, 0x3f5a, 0x3f5a, 0x3f5b, 0x3f5b, 0x3f5b,
    0x3f5b, 0x3f5c, 0x3f5c, 0x3f5c, 0x3f5c, 0x3f5d, 0x3f5d, 0x3f5d, 0x3f5e,
    0x3f5e, 0x3f5e, 0x3f5e, 0x3f5f, 0x3f5f, 0x3f5f, 0x3f5f, 0x3f60, 0x3f60,
    0x3f60, 0x3f60, 0x3f61, 0x3f61, 0x3f61, 0x3f61, 0x3f62, 0x3f61, 0x3f61,
    0x3f61, 0x3f62, 0x3f62, 0x3f62, 0x3f62, 0x3f63, 0x3f63, 0x3f63, 0x3f63,
    0x3f64, 0x3f64, 0x3f64, 0x3f64, 0x3f65, 0x3f65, 0x3f65, 0x3f65, 0x3f66,
    0x3f66, 0x3f66, 0x3f66, 0x3f66, 0x3f66, 0x3f66, 0x3f66, 0x3f67, 0x3f67,
    0x3f67, 0x3f67, 0x3f68, 0x3f68, 0x3f68, 0x3f68, 0x3f69, 0x3f69, 0x3f69,
    0x3f69, 0x3f69, 0x3f69, 0x3f69, 0x3f6a, 0x3f6a, 0x3f6a, 0x3f6a, 0x3f6a,
    0x3f6a, 0x3f6a, 0x3f6a, 0x3f6b, 0x3f6b, 0x3f6b, 0x3f6b, 0x3f6b, 0x3f6b,
    0x3f6b, 0x3f6b, 0x3f6c, 0x3f6c, 0x3f6c, 0x3f6c, 0x3f6d, 0x3f6d, 0x3f6d,
    0x3f6d, 0x3f6e, 0x3f6e, 0x3f6e, 0x3f6e, 0x3f6e, 0x3f6e, 0x3f6e, 0x3f6e,
    0x3f6f, 0x3f6f, 0x3f6f, 0x3f6f, 0x3f6f, 0x3f6f, 0x3f6f, 0x3f6f, 0x3f6f,
    0x3f6f, 0x3f70, 0x3f70, 0x3f70, 0x3f70, 0x3f70, 0x3f70, 0x3f70, 0x3f71,
    0x3f71, 0x3f71, 0x3f71, 0x3f71, 0x3f71, 0x3f71, 0x3f71, 0x3f72, 0x3f72,
    0x3f71, 0x3f71, 0x3f71, 0x3f71, 0x3f71, 0x3f71, 0x3f72, 0x3f72, 0x3f72,
    0x3f72, 0x3f72, 0x3f72, 0x3f72, 0x3f72, 0x3f73, 0x3f73, 0x3f73, 0x3f73,
    0x3f73, 0x3f73, 0x3f73, 0x3f73, 0x3f74, 0x3f74, 0x3f74, 0x3f74, 0x3f74,
    0x3f74, 0x3f74, 0x3f75, 0x3f75, 0x3f75, 0x3f75, 0x3f75, 0x3f75, 0x3f75,
    0x3f75, 0x3f75, 0x3f75, 0x3f75, 0x3f75, 0x3f75, 0x3f75, 0x3f75, 0x3f75,
    0x3f75, 0x3f75, 0x3f76, 0x3f76, 0x3f76, 0x3f76, 0x3f76, 0x3f76, 0x3f76,
    0x3f76, 0x3f76, 0x3f76, 0x3f76, 0x3f76, 0x3f76, 0x3f76, 0x3f76, 0x3f76,
    0x3f77, 0x3f77, 0x3f77, 0x3f77, 0x3f77, 0x3f77, 0x3f77, 0x3f78, 0x3f78,
    0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78,
    0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78,
    0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f79, 0x3f79, 0x3f79, 0x3f79, 0x3f79,
    0x3f79, 0x3f79, 0x3f79, 0x3f79, 0x3f79, 0x3f79, 0x3f79, 0x3f79, 0x3f79,
    0x3f79, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a,
    0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a,
    0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7a, 0x3f7b, 0x3f7b,
    0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b,
    0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b, 0x3f7b,
    0x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, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f,
    0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f,
    0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f7f, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80, 0x3f80,
    0x3f80, 0x3eff, 0x3efe, 0x3efd, 0x3efc, 0x3efb, 0x3efa, 0x3ef9, 0x3ef8,
    0x3ef7, 0x3ef6, 0x3ef5, 0x3ef4, 0x3ef3, 0x3ef2, 0x3ef1, 0x3ef0, 0x3eef,
    0x3eee, 0x3eed, 0x3eec, 0x3eeb, 0x3eea, 0x3ee9, 0x3ee7, 0x3ee6, 0x3ee5,
    0x3ee4, 0x3ee3, 0x3ee2, 0x3ee1, 0x3ee0, 0x3edf, 0x3ede, 0x3edd, 0x3edc,
    0x3edb, 0x3eda, 0x3ed9, 0x3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x3e4f, 0x3e4e, 0x3e4c, 0x3e4b, 0x3e4a, 0x3e49, 0x3e47, 0x3e46,
    0x3e45, 0x3e44, 0x3e43, 0x3e41, 0x3e40, 0x3e3f, 0x3e3e, 0x3e3c, 0x3e3a,
    0x3e39, 0x3e37, 0x3e36, 0x3e35, 0x3e34, 0x3e33, 0x3e31, 0x3e30, 0x3e2f,
    0x3e2e, 0x3e2c, 0x3e2b, 0x3e2a, 0x3e29, 0x3e28, 0x3e27, 0x3e26, 0x3e25,
    0x3e24, 0x3e23, 0x3e22, 0x3e20, 0x3e20, 0x3e1f, 0x3e1e, 0x3e1d, 0x3e1c,
    0x3e1b, 0x3e1a, 0x3e19, 0x3e18, 0x3e17, 0x3e16, 0x3e15, 0x3e14, 0x3e13,
    0x3e12, 0x3e11, 0x3e10, 0x3e0f, 0x3e0e, 0x3e0c, 0x3e0b, 0x3e0a, 0x3e09,
    0x3e08, 0x3e07, 0x3e06, 0x3e05, 0x3e04, 0x3e03, 0x3e03, 0x3e02, 0x3e01,
    0x3e00, 0x3dff, 0x3dfd, 0x3dfb, 0x3df9, 0x3df8, 0x3df6, 0x3df4, 0x3df1,
    0x3df1, 0x3ded, 0x3ded, 0x3dea, 0x3dea, 0x3de7, 0x3de7, 0x3de4, 0x3de4,
    0x3de1, 0x3de1, 0x3dde, 0x3dde, 0x3ddb, 0x3ddb, 0x3dd8, 0x3dd8, 0x3dd5,
    0x3dd5, 0x3dd2, 0x3dd2, 0x3dcf, 0x3dcf, 0x3dcc, 0x3dcc, 0x3dc9, 0x3dc9,
    0x3dc7, 0x3dc7, 0x3dc3, 0x3dc3, 0x3dc0, 0x3dc0, 0x3dbe, 0x3dbe, 0x3dbb,
    0x3dbb, 0x3db9, 0x3db9, 0x3db6, 0x3db4, 0x3db4, 0x3db1, 0x3db1, 0x3dae,
    0x3dae, 0x3dac, 0x3dac, 0x3da9, 0x3da9, 0x3da7, 0x3da7, 0x3da5, 0x3da5,
    0x3da3, 0x3da3, 0x3da0, 0x3da0, 0x3d9e, 0x3d9e, 0x3d9b, 0x3d9b, 0x3d99,
    0x3d99, 0x3d97, 0x3d97, 0x3d94, 0x3d94, 0x3d93, 0x3d93, 0x3d91, 0x3d91,
    0x3d8f, 0x3d8f, 0x3d8d, 0x3d8d, 0x3d8a, 0x3d8a, 0x3d88, 0x3d88, 0x3d86,
    0x3d86, 0x3d84, 0x3d82, 0x3d82, 0x3d80, 0x3d80, 0x3d7d, 0x3d7d, 0x3d79,
    0x3d79, 0x3d76, 0x3d76, 0x3d72, 0x3d72, 0x3d6f, 0x3d6f, 0x3d6b, 0x3d6b,
    0x3d68, 0x3d68, 0x3d65, 0x3d65, 0x3d61, 0x3d61, 0x3d5e, 0x3d5e, 0x3d5b,
    0x3d5b, 0x3d58, 0x3d58, 0x3d55, 0x3d55, 0x3d52, 0x3d52, 0x3d4e, 0x3d4e,
    0x3d4b, 0x3d4b, 0x3d48, 0x3d48, 0x3d45, 0x3d45, 0x3d42, 0x3d3f, 0x3d3f,
    0x3d3c, 0x3d3c, 0x3d3a, 0x3d3a, 0x3d37, 0x3d37, 0x3d34, 0x3d34, 0x3d32,
    0x3d32, 0x3d2f, 0x3d2f, 0x3d2c, 0x3d2c, 0x3d2a, 0x3d2a, 0x3d27, 0x3d27,
    0x3d24, 0x3d24, 0x3d22, 0x3d22, 0x3d20, 0x3d20, 0x3d1d, 0x3d1d, 0x3d1b,
    0x3d1b, 0x3d19, 0x3d19, 0x3d17, 0x3d17, 0x3d15, 0x3d15, 0x3d12, 0x3d12,
    0x3d10, 0x3d10, 0x3d0e, 0x3d0c, 0x3d0c, 0x3d0a, 0x3d0a, 0x3d08, 0x3d08,
    0x3d06, 0x3d06, 0x3d04, 0x3d04, 0x3d02, 0x3d02, 0x3cff, 0x3cff, 0x3cfb,
    0x3cfb, 0x3cf8, 0x3cf8, 0x3cf4, 0x3cf4, 0x3cf0, 0x3cf0, 0x3cec, 0x3cec,
    0x3ce9, 0x3ce9, 0x3ce5, 0x3ce5, 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, 0x3c1f, 0x3c1f, 0x3c1f, 0x3c1a, 0x3c1a, 0x3c1a, 0x3c16,
    0x3c16, 0x3c16, 0x3c16, 0x3c12, 0x3c12, 0x3c12, 0x3c12, 0x3c0d, 0x3c0d,
    0x3c0d, 0x3c0d, 0x3c09, 0x3c09, 0x3c09, 0x3c09, 0x3c04, 0x3c04, 0x3c04,
    0x3c04, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3bf8, 0x3bf8, 0x3bf8, 0x3bf8,
    0x3bf1, 0x3bf1, 0x3bf1, 0x3bf1, 0x3be9, 0x3be9, 0x3be9, 0x3be9, 0x3be2,
    0x3be2, 0x3be2, 0x3be2, 0x3bdb, 0x3bdb, 0x3bdb, 0x3bd4, 0x3bd4, 0x3bd4,
    0x3bd4, 0x3bce, 0x3bce, 0x3bce, 0x3bce, 0x3bc8, 0x3bc8, 0x3bc8, 0x3bc8,
    0x3bc2, 0x3bc2, 0x3bc2, 0x3bc2, 0x3bbc, 0x3bbc, 0x3bbc, 0x3bbc, 0x3bb6,
    0x3bb6, 0x3bb6, 0x3bb6, 0x3bb0, 0x3bb0, 0x3bb0, 0x3bb0, 0x3bab, 0x3bab,
    0x3bab, 0x3bab, 0x3ba6, 0x3ba6, 0x3ba6, 0x3ba6, 0x3ba1, 0x3ba1, 0x3ba1,
    0x3ba1, 0x3b9c, 0x3b9c, 0x3b9c, 0x3b97, 0x3b97, 0x3b97, 0x3b97, 0x3b92,
    0x3b92, 0x3b92, 0x3b92, 0x3b8e, 0x3b8e, 0x3b8e, 0x3b8e, 0x3b8a, 0x3b8a,
    0x3b8a, 0x3b8a, 0x3b85, 0x3b85, 0x3b85, 0x3b85, 0x3b81, 0x3b81, 0x3b81,
    0x3b81, 0x3b7b, 0x3b7b, 0x3b7b, 0x3b7b, 0x3b73, 0x3b73, 0x3b73, 0x3b73,
    0x3b6c, 0x3b6c, 0x3b6c, 0x3b6c, 0x3b65, 0x3b65, 0x3b65, 0x3b5d, 0x3b5d,
    0x3b5d, 0x3b5d, 0x3b56, 0x3b56, 0x3b56, 0x3b56, 0x3b50, 0x3b50, 0x3b50,
    0x3b50, 0x3b4a, 0x3b4a, 0x3b4a, 0x3b4a, 0x3b43, 0x3b43, 0x3b43, 0x3b43,
    0x3b3d, 0x3b3d, 0x3b3d, 0x3b3d, 0x3b38, 0x3b38, 0x3b38, 0x3b38, 0x3b32,
    0x3b32, 0x3b32, 0x3b32, 0x3b2c, 0x3b2c, 0x3b2c, 0x3b2c, 0x3b27, 0x3b27,
    0x3b27, 0x3b27, 0x3b22, 0x3b22, 0x3b22, 0x3b1d, 0x3b1d, 0x3b1d, 0x3b1d,
    0x3b18, 0x3b18, 0x3b18, 0x3b18, 0x3b13, 0x3b13, 0x3b13, 0x3b13, 0x3b0f,
    0x3b0f, 0x3b0f, 0x3b0f, 0x3b0b, 0x3b0b, 0x3b0b, 0x3b0b, 0x3b06, 0x3b06,
    0x3b06, 0x3b06, 0x3b02, 0x3b02, 0x3b02, 0x3b02, 0x3afd, 0x3afd, 0x3afd,
    0x3afd, 0x3af5, 0x3af5, 0x3af5, 0x3af5, 0x3aed, 0x3aed, 0x3aed, 0x3aed,
    0x3ae6, 0x3ae6, 0x3ae6, 0x3adf, 0x3adf, 0x3adf, 0x3adf, 0x3ad8, 0x3ad8,
    0x3ad8, 0x3ad8, 0x3ad1, 0x3ad1, 0x3ad1, 0x3ad1, 0x3acb, 0x3acb, 0x3acb,
    0x3acb, 0x3ac5, 0x3ac5, 0x3ac5, 0x3ac5, 0x3abf, 0x3abf, 0x3abf, 0x3abf,
    0x3ab9, 0x3ab9, 0x3ab9, 0x3ab9, 0x3ab3, 0x3ab3, 0x3ab3, 0x3ab3, 0x3aae,
    0x3aae, 0x3aae, 0x3aae, 0x3aa9, 0x3aa9, 0x3aa9, 0x3aa3, 0x3aa3, 0x3aa3,
    0x3aa3, 0x3a9e, 0x3a9e, 0x3a9e, 0x3a9e, 0x3a99, 0x3a99, 0x3a99, 0x3a99,
    0x3a94, 0x3a94, 0x3a94, 0x3a94, 0x3a90, 0x3a90, 0x3a90, 0x3a90, 0x3a8c,
    0x3a8c, 0x3a8c, 0x3a8c, 0x3a87, 0x3a87, 0x3a87, 0x3a87, 0x3a83, 0x3a83,
    0x3a83, 0x3a83, 0x3a7e, 0x3a7e, 0x3a7e, 0x3a7e, 0x3a76, 0x3a76, 0x3a76,
    0x3a76, 0x3a6f, 0x3a6f, 0x3a6f, 0x3a68, 0x3a68, 0x3a68, 0x3a68, 0x3a60,
    0x3a60, 0x3a60, 0x3a60, 0x3a59, 0x3a59, 0x3a59, 0x3a59, 0x3a53, 0x3a53,
    0x3a53, 0x3a53, 0x3a4d, 0x3a4d, 0x3a4d, 0x3a4d, 0x3a46, 0x3a46, 0x3a46,
    0x3a46, 0x3a40, 0x3a40, 0x3a40, 0x3a40, 0x3a3a, 0x3a3a, 0x3a3a, 0x3a3a,
    0x3a34, 0x3a34, 0x3a34, 0x3a34, 0x3a2f, 0x3a2f, 0x3a2f, 0x3a2f, 0x3a2a,
    0x3a2a, 0x3a2a, 0x3a24, 0x3a24, 0x3a24, 0x3a24, 0x3a1f, 0x3a1f, 0x3a1f,
    0x3a1f, 0x3a1a, 0x3a1a, 0x3a1a, 0x3a1a, 0x3a15, 0x3a15, 0x3a15, 0x3a15,
    0x3a11, 0x3a11, 0x3a11, 0x3a11, 0x3a0d, 0x3a0d, 0x3a0d, 0x3a0d, 0x3a08,
    0x3a08, 0x3a08, 0x3a08, 0x3a04, 0x3a04, 0x3a04, 0x3a04, 0x3a00, 0x3a00,
    0x3a00, 0x3a00, 0x39f8, 0x39f8, 0x39f8, 0x39f0, 0x39f0, 0x39f0, 0x39f0,
    0x39e9, 0x39e9, 0x39e9, 0x39e9, 0x39e2, 0x39e2, 0x39e2, 0x39e2, 0x39db,
    0x39db, 0x39db, 0x39db, 0x39d4, 0x39d4, 0x39d4, 0x39d4, 0x39ce, 0x39ce,
    0x39ce, 0x39ce, 0x39c7, 0x39c7, 0x39c7, 0x39c7, 0x39c1, 0x39c1, 0x39c1,
    0x39c1, 0x39bb, 0x39bb, 0x39bb, 0x39bb, 0x39b5, 0x39b5, 0x39b5, 0x39b5,
    0x39b0, 0x39b0,
};

// FIXME: not hard code
// contribute from hw, fix with `PRE_DATA` input
static double sigmode_golden[] = {
    0.5,         0.501999989, 0.503999915, 0.505999712, 0.507999317,
    0.509998667, 0.511997697, 0.513996342, 0.515994541, 0.517992228,
    0.51998934,  0.521985814, 0.523981585, 0.525976591, 0.527970767,
    0.529964052, 0.531956381, 0.533947691, 0.535937921, 0.537927006,
    0.539914885, 0.541901494, 0.543886772, 0.545870657, 0.547853086,
    0.549833997, 0.55181333,  0.553791023, 0.555767014, 0.557741243,
    0.559713649, 0.561684172, 0.56365275,  0.565619325, 0.567583836,
    0.569546224, 0.571506429, 0.573464394, 0.575420058, 0.577373363,
    0.579324252, 0.581272667, 0.583218549, 0.585161842, 0.58710249,
    0.589040434, 0.59097562,  0.59290799,  0.594837491, 0.596764066,
    0.59868766,  0.60060822,  0.60252569,  0.604440017, 0.606351149,
    0.608259031, 0.610163611, 0.612064837, 0.613962657, 0.61585702,
    0.617747875, 0.61963517,  0.621518857, 0.623398885, 0.625275204,
    0.627147766, 0.629016523, 0.630881426, 0.632742428, 0.634599482,
    0.63645254,  0.638301558, 0.640146488, 0.641987286, 0.643823907,
    0.645656306, 0.64748444,  0.649308265, 0.651127739, 0.652942818,
    0.654753461, 0.656559626, 0.658361272, 0.66015836,  0.661950848,
    0.663738697, 0.665521869, 0.667300325, 0.669074026, 0.670842936,
    0.672607017, 0.674366233, 0.676120548, 0.677869926, 0.679614333,
    0.681353734, 0.683088095, 0.684817383, 0.686541565, 0.688260608,
    0.689974481, 0.691683153, 0.693386592, 0.695084769, 0.696777653,
    0.698465216, 0.700147429, 0.701824263, 0.703495691, 0.705161686,
    0.706822221, 0.70847727,  0.710126808, 0.71177081,  0.71340925,
    0.715042106, 0.716669353, 0.718290968, 0.71990693,  0.721517216,
    0.723121805, 0.724720676, 0.726313808, 0.727901182, 0.729482779,
    0.731058579, 0.732628564, 0.734192716, 0.735751018, 0.737303454,
    0.738850006, 0.740390659, 0.741925398, 0.743454208, 0.744977074,
    0.746493983, 0.748004922, 0.749509876, 0.751008835, 0.752501785,
    0.753988716, 0.755469617, 0.756944477, 0.758413287, 0.759876035,
    0.761332715, 0.762783316, 0.764227831, 0.765666252, 0.767098572,
    0.768524783, 0.769944881, 0.771358858, 0.772766709, 0.774168429,
    0.775564014, 0.77695346,  0.778336762, 0.779713917, 0.781084923,
    0.782449776, 0.783808476, 0.78516102,  0.786507407, 0.787847636,
    0.789181707, 0.790509619, 0.791831373, 0.79314697,  0.794456411,
    0.795759698, 0.797056831, 0.798347814, 0.79963265,  0.80091134,
    0.802183889, 0.803450299, 0.804710577, 0.805964724, 0.807212748,
    0.808454651, 0.809690441, 0.810920123, 0.812143702, 0.813361186,
    0.814572581, 0.815777894, 0.816977132, 0.818170304, 0.819357418,
    0.820538481, 0.821713502, 0.82288249,  0.824045455, 0.825202406,
    0.826353353, 0.827498306, 0.828637274, 0.82977027,  0.830897303,
    0.832018385, 0.833133528, 0.834242742, 0.83534604,  0.836443435,
    0.837534937, 0.838620561, 0.83970032,  0.840774225, 0.841842291,
    0.842904531, 0.843960959, 0.84501159,  0.846056436, 0.847095514,
    0.848128836, 0.84915642,  0.850178278, 0.851194427, 0.852204883,
    0.85320966,  0.854208775, 0.855202244, 0.856190082, 0.857172307,
    0.858148935, 0.859119982, 0.860085466, 0.861045403, 0.861999811,
    0.862948707, 0.863892109, 0.864830034, 0.8657625,   0.866689525,
    0.867611126, 0.868527324, 0.869438134, 0.870343577, 0.871243671,
    0.872138434, 0.873027885, 0.873912043, 0.874790928, 0.875664558,
    0.876532952, 0.877396131, 0.878254114, 0.879106919, 0.879954567,
    0.880797078, 0.881634471, 0.882466767, 0.883293985, 0.884116145,
    0.884933268, 0.885745374, 0.886552483, 0.887354615, 0.888151792,
    0.888944033, 0.88973136,  0.890513792, 0.89129135,  0.892064056,
    0.89283193,  0.893594992, 0.894353264, 0.895106767, 0.895855521,
    0.896599549, 0.897338869, 0.898073505, 0.898803476, 0.899528804,
    0.900249511, 0.900965617, 0.901677143, 0.902384111, 0.903086543,
    0.903784458, 0.90447788,  0.905166828, 0.905851324, 0.90653139,
    0.907207047, 0.907878316, 0.908545218, 0.909207776, 0.90986601,
    0.910519941, 0.911169591, 0.911814981, 0.912456133, 0.913093067,
    0.913725806, 0.914354369, 0.91497878,  0.915599058, 0.916215226,
    0.916827304, 0.917435313, 0.918039275, 0.91863921,  0.919235141,
    0.919827088, 0.920415072, 0.920999114, 0.921579235, 0.922155456,
    0.922727798, 0.923296282, 0.923860929, 0.92442176,  0.924978795,
    0.925532055, 0.926081561, 0.926627334, 0.927169394, 0.927707762,
    0.928242458, 0.928773503, 0.929300917, 0.929824721, 0.930344935,
    0.93086158,  0.931374675, 0.931884241, 0.932390297, 0.932892865,
    0.933391964, 0.933887615, 0.934379836, 0.934868648, 0.93535407,
    0.935836124, 0.936314827, 0.9367902,   0.937262263, 0.937731034,
    0.938196534, 0.938658781, 0.939117796, 0.939573597, 0.940026203,
    0.940475634, 0.940921909, 0.941365046, 0.941805065, 0.942241985,
    0.942675824, 0.943106601, 0.943534335, 0.943959044, 0.944380747,
    0.944799462, 0.945215208, 0.945628003, 0.946037865, 0.946444813,
    0.946848864, 0.947250036, 0.947648348, 0.948043817, 0.948436462,
    0.948826299, 0.949213347, 0.949597623, 0.949979144, 0.950357929,
    0.950733994, 0.951107357, 0.951478034, 0.951846044, 0.952211402,
    0.952574127, 0.952934234, 0.953291742, 0.953646665, 0.953999022,
    0.954348829, 0.954696102, 0.955040858, 0.955383113, 0.955722883,
    0.956060185, 0.956395034, 0.956727447, 0.95705744,  0.957385028,
    0.957710228, 0.958033055, 0.958353525, 0.958671653, 0.958987455,
    0.959300946, 0.959612142, 0.959921058, 0.960227709, 0.960532111,
    0.960834277, 0.961134224, 0.961431966, 0.961727518, 0.962020894,
    0.962312109, 0.962601179, 0.962888117, 0.963172937, 0.963455655,
    0.963736284, 0.964014838, 0.964291332, 0.96456578,  0.964838195,
    0.965108591, 0.965376983, 0.965643384, 0.965907808, 0.966170267,
    0.966430777, 0.966689349, 0.966945998, 0.967200737, 0.967453578,
    0.967704535, 0.967953622, 0.96820085,  0.968446233, 0.968689784,
    0.968931516, 0.96917144,  0.969409571, 0.969645919, 0.969880498,
    0.97011332,  0.970344398, 0.970573743, 0.970801367, 0.971027284,
    0.971251504, 0.97147404,  0.971694904, 0.971914107, 0.972131661,
    0.972347578, 0.972561869, 0.972774546, 0.97298562,  0.973195103,
    0.973403006, 0.973609341, 0.973814117, 0.974017347, 0.974219042,
    0.974419212, 0.974617868, 0.974815021, 0.975010683, 0.975204863,
    0.975397572, 0.97558882,  0.975778619, 0.975966979, 0.97615391,
    0.976339422, 0.976523525, 0.97670623,  0.976887547, 0.977067486,
    0.977246057, 0.977423269, 0.977599132, 0.977773657, 0.977946853,
    0.978118729, 0.978289296, 0.978458562, 0.978626537, 0.978793231,
    0.978958653, 0.979122812, 0.979285717, 0.979447378, 0.979607804,
    0.979767003, 0.979924985, 0.980081758, 0.980237332, 0.980391715,
    0.980544915, 0.980696943, 0.980847805, 0.980997512, 0.981146071,
    0.98129349,  0.981439779, 0.981584945, 0.981728996, 0.981871942,
    0.98201379,  0.982154548, 0.982294225, 0.982432827, 0.982570364,
    0.982706843, 0.982842273, 0.982976659, 0.983110012, 0.983242337,
    0.983373644, 0.983503939, 0.983633229, 0.983761524, 0.983888829,
    0.984015152, 0.9841405,   0.984264882, 0.984388303, 0.984510772,
    0.984632294, 0.984752879, 0.984872531, 0.984991259, 0.985109069,
    0.985225968, 0.985341963, 0.985457061, 0.985571269, 0.985684592,
    0.985797039, 0.985908614, 0.986019326, 0.98612918,  0.986238183,
    0.986346341, 0.986453661, 0.986560148, 0.98666581,  0.986770653,
    0.986874682, 0.986977903, 0.987080324, 0.98718195,  0.987282786,
    0.987382839, 0.987482115, 0.98758062,  0.98767836,  0.987775339,
    0.987871565, 0.987967043, 0.988061778, 0.988155776, 0.988249042,
    0.988341583, 0.988433404, 0.98852451,  0.988614907, 0.9887046,
    0.988793594, 0.988881895, 0.988969507, 0.989056437, 0.98914269,
    0.98922827,  0.989313183, 0.989397433, 0.989481027, 0.989563968,
    0.989646262, 0.989727914, 0.989808929, 0.989889312, 0.989969066,
    0.990048198, 0.990126712, 0.990204613, 0.990281905, 0.990358593,
    0.990434681, 0.990510175, 0.990585079, 0.990659397, 0.990733134,
    0.990806295, 0.990878883, 0.990950903, 0.99102236,  0.991093257,
    0.9911636,   0.991233391, 0.991302637, 0.99137134,  0.991439506,
    0.991507137, 0.991574239, 0.991640815, 0.991706869, 0.991772406,
    0.991837429, 0.991901942, 0.99196595,  0.992029456, 0.992092463,
    0.992154977, 0.992217,    0.992278537, 0.992339591, 0.992400166,
    0.992460265, 0.992519893, 0.992579053, 0.992637749, 0.992695983,
    0.99275376,  0.992811084, 0.992867957, 0.992924384, 0.992980367,
    0.993035911, 0.993091018, 0.993145692, 0.993199936, 0.993253754,
    0.993307149, 0.993360124, 0.993412683, 0.993464828, 0.993516563,
    0.993567892, 0.993618816, 0.99366934,  0.993719466, 0.993769198,
    0.993818539, 0.993867491, 0.993916059, 0.993964243, 0.994012049,
    0.994059478, 0.994106533, 0.994153219, 0.994199536, 0.994245489,
    0.994291079, 0.994336311, 0.994381186, 0.994425708, 0.994469878,
    0.994513701, 0.994557178, 0.994600313, 0.994643108, 0.994685565,
    0.994727688, 0.994769478, 0.994810939, 0.994852073, 0.994892883,
    0.994933371, 0.994973539, 0.995013391, 0.995052928, 0.995092153,
    0.995131069, 0.995169677, 0.995207981, 0.995245983, 0.995283685,
    0.995321089, 0.995358198, 0.995395014, 0.995431539, 0.995467776,
    0.995503727, 0.995539394, 0.995574779, 0.995609885, 0.995644713,
    0.995679266, 0.995713547, 0.995747556, 0.995781297, 0.995814772,
    0.995847981, 0.995880929, 0.995913616, 0.995946044, 0.995978217,
    0.996010135, 0.996041801, 0.996073216, 0.996104383, 0.996135304,
    0.99616598,  0.996196413, 0.996226606, 0.996256561, 0.996286278,
    0.99631576,  0.996345009, 0.996374027, 0.996402815, 0.996431375,
    0.99645971,  0.99648782,  0.996515708, 0.996543375, 0.996570823,
    0.996598054, 0.99662507,  0.996651872, 0.996678461, 0.99670484,
    0.99673101,  0.996756974, 0.996782731, 0.996808285, 0.996833636,
    0.996858787, 0.996883738, 0.996908492, 0.99693305,  0.996957413,
    0.996981584, 0.997005563, 0.997029352, 0.997052952, 0.997076366,
    0.997099594, 0.997122638, 0.9971455,   0.99716818,  0.997190681,
    0.997213004, 0.997235149, 0.99725712,  0.997278916, 0.997300539,
    0.997321991, 0.997343273, 0.997364386, 0.997385332, 0.997406112,
    0.997426727, 0.997447179, 0.997467468, 0.997487597, 0.997507566,
    0.997527377, 0.997547031, 0.997566528, 0.997585872, 0.997605062,
    0.997624099, 0.997642986, 0.997661723, 0.997680312, 0.997698752,
    0.997717047, 0.997735197, 0.997753202, 0.997771065, 0.997788786,
    0.997806367, 0.997823808, 0.99784111,  0.997858276, 0.997875305,
    0.997892199, 0.997908959, 0.997925586, 0.997942081, 0.997958445,
    0.99797468,  0.997990785, 0.998006763, 0.998022614, 0.998038339,
    0.998053939, 0.998069415, 0.998084769, 0.998100001, 0.998115112,
    0.998130102, 0.998144974, 0.998159728, 0.998174365, 0.998188885,
    0.99820329,  0.998217581, 0.998231759, 0.998245823, 0.998259777,
    0.998273619, 0.998287351, 0.998300975, 0.99831449,  0.998327898,
    0.998341199, 0.998354395, 0.998367486, 0.998380473, 0.998393356,
    0.998406138, 0.998418818, 0.998431397, 0.998443876, 0.998456256,
    0.998468538, 0.998480723, 0.99849281,  0.998504802, 0.998516698,
    0.998528499, 0.998540207, 0.998551822, 0.998563345, 0.998574776,
    0.998586116, 0.998597366, 0.998608527, 0.998619599, 0.998630583,
    0.99864148,  0.99865229,  0.998663015, 0.998673654, 0.998684208,
    0.998694679, 0.998705066, 0.998715371, 0.998725594, 0.998735736,
    0.998745797, 0.998755778, 0.99876568,  0.998775503, 0.998785248,
    0.998794916, 0.998804507, 0.998814021, 0.99882346,  0.998832824,
    0.998842113, 0.998851329, 0.998860471, 0.998869541, 0.998878538,
    0.998887464, 0.998896319, 0.998905104, 0.998913818, 0.998922464,
    0.99893104,  0.998939549, 0.99894799,  0.998956364, 0.998964671,
    0.998972912, 0.998981088, 0.998989198, 0.998997244, 0.999005226,
    0.999013145, 0.999021001, 0.999028794, 0.999036525, 0.999044195,
    0.999051803, 0.999059352, 0.99906684,  0.999074268, 0.999081638,
    0.999088949, 0.999096202, 0.999103397, 0.999110535, 0.999117616,
    0.99912464,  0.999131609, 0.999138523, 0.999145381, 0.999152185,
    0.999158935, 0.999165631, 0.999172274, 0.999178864, 0.999185401,
    0.999191887, 0.999198321, 0.999204704, 0.999211036, 0.999217317,
    0.999223549, 0.999229731, 0.999235864, 0.999241948, 0.999247984,
    0.999253971, 0.999259911, 0.999265804, 0.99927165,  0.999277449,
    0.999283202, 0.99928891,  0.999294572, 0.999300189, 0.999305761,
    0.999311289, 0.999316773, 0.999322213, 0.99932761,  0.999332964,
    0.999338276, 0.999343545, 0.999348772, 0.999353958, 0.999359103,
    0.999364206, 0.999369269, 0.999374291, 0.999379274, 0.999384217,
    0.999389121, 0.999393985, 0.999398811, 0.999403599, 0.999408348,
    0.99941306,  0.999417734, 0.99942237,  0.99942697,  0.999431534,
    0.999436061, 0.999440552, 0.999445007, 0.999449427, 0.999453811,
    0.999458161, 0.999462476, 0.999466757, 0.999471004, 0.999475217,
    0.999479396, 0.999483542, 0.999487655, 0.999491735, 0.999495783,
    0.999499799, 0.999503783, 0.999507735, 0.999511655, 0.999515544,
    0.999519403, 0.99952323,  0.999527027, 0.999530794, 0.999534531,
    0.999538238, 0.999541916, 0.999545564, 0.999549184, 0.999552774,
    0.999556336, 0.99955987,  0.999563375, 0.999566853, 0.999570303,
    0.999573725, 0.99957712,  0.999580488, 0.99958383,  0.999587145,
    0.999590433, 0.999593695, 0.999596931, 0.999600142, 0.999603326,
    0.999606486, 0.99960962,  0.99961273,  0.999615814, 0.999618874,
    0.99962191,  0.999624921, 0.999627909, 0.999630873, 0.999633813,
    0.99963673,  0.999639623, 0.999642494, 0.999645341, 0.999648166,
    0.999650969, 0.999653749, 0.999656507, 0.999659243, 0.999661957,
    0.498000011, 0.496000085, 0.494000288, 0.492000683, 0.490001333,
    0.488002303, 0.486003658, 0.484005459, 0.482007772, 0.48001066,
    0.478014186, 0.476018415, 0.474023409, 0.472029233, 0.470035948,
    0.468043619, 0.466052309, 0.464062079, 0.462072994, 0.460085115,
    0.458098506, 0.456113228, 0.454129343, 0.452146914, 0.450166003,
    0.44818667,  0.446208977, 0.444232986, 0.442258757, 0.440286351,
    0.438315828, 0.43634725,  0.434380675, 0.432416164, 0.430453776,
    0.428493571, 0.426535606, 0.424579942, 0.422626637, 0.420675748,
    0.418727333, 0.416781451, 0.414838158, 0.41289751,  0.410959566,
    0.40902438,  0.40709201,  0.405162509, 0.403235934, 0.40131234,
    0.39939178,  0.39747431,  0.395559983, 0.393648851, 0.391740969,
    0.389836389, 0.387935163, 0.386037343, 0.38414298,  0.382252125,
    0.38036483,  0.378481143, 0.376601115, 0.374724796, 0.372852234,
    0.370983477, 0.369118574, 0.367257572, 0.365400518, 0.36354746,
    0.361698442, 0.359853512, 0.358012714, 0.356176093, 0.354343694,
    0.35251556,  0.350691735, 0.348872261, 0.347057182, 0.345246539,
    0.343440374, 0.341638728, 0.33984164,  0.338049152, 0.336261303,
    0.334478131, 0.332699675, 0.330925974, 0.329157064, 0.327392983,
    0.325633767, 0.323879452, 0.322130074, 0.320385667, 0.318646266,
    0.316911905, 0.315182617, 0.313458435, 0.311739392, 0.310025519,
    0.308316847, 0.306613408, 0.304915231, 0.303222347, 0.301534784,
    0.299852571, 0.298175737, 0.296504309, 0.294838314, 0.293177779,
    0.29152273,  0.289873192, 0.28822919,  0.28659075,  0.284957894,
    0.283330647, 0.281709032, 0.28009307,  0.278482784, 0.276878195,
    0.275279324, 0.273686192, 0.272098818, 0.270517221, 0.268941421,
    0.267371436, 0.265807284, 0.264248982, 0.262696546, 0.261149994,
    0.259609341, 0.258074602, 0.256545792, 0.255022926, 0.253506017,
    0.251995078, 0.250490124, 0.248991165, 0.247498215, 0.246011284,
    0.244530383, 0.243055523, 0.241586713, 0.240123965, 0.238667285,
    0.237216684, 0.235772169, 0.234333748, 0.232901428, 0.231475217,
    0.230055119, 0.228641142, 0.227233291, 0.225831571, 0.224435986,
    0.22304654,  0.221663238, 0.220286083, 0.218915077, 0.217550224,
    0.216191524, 0.21483898,  0.213492593, 0.212152364, 0.210818293,
    0.209490381, 0.208168627, 0.20685303,  0.205543589, 0.204240302,
    0.202943169, 0.201652186, 0.20036735,  0.19908866,  0.197816111,
    0.196549701, 0.195289423, 0.194035276, 0.192787252, 0.191545349,
    0.190309559, 0.189079877, 0.187856298, 0.186638814, 0.185427419,
    0.184222106, 0.183022868, 0.181829696, 0.180642582, 0.179461519,
    0.178286498, 0.17711751,  0.175954545, 0.174797594, 0.173646647,
    0.172501694, 0.171362726, 0.17022973,  0.169102697, 0.167981615,
    0.166866472, 0.165757258, 0.16465396,  0.163556565, 0.162465063,
    0.161379439, 0.16029968,  0.159225775, 0.158157709, 0.157095469,
    0.156039041, 0.15498841,  0.153943564, 0.152904486, 0.151871164,
    0.15084358,  0.149821722, 0.148805573, 0.147795117, 0.14679034,
    0.145791225, 0.144797756, 0.143809918, 0.142827693, 0.141851065,
    0.140880018, 0.139914534, 0.138954597, 0.138000189, 0.137051293,
    0.136107891, 0.135169966, 0.1342375,   0.133310475, 0.132388874,
    0.131472676, 0.130561866, 0.129656423, 0.128756329, 0.127861566,
    0.126972115, 0.126087957, 0.125209072, 0.124335442, 0.123467048,
    0.122603869, 0.121745886, 0.120893081, 0.120045433, 0.119202922,
    0.118365529, 0.117533233, 0.116706015, 0.115883855, 0.115066732,
    0.114254626, 0.113447517, 0.112645385, 0.111848208, 0.111055967,
    0.11026864,  0.109486208, 0.10870865,  0.107935944, 0.10716807,
    0.106405008, 0.105646736, 0.104893233, 0.104144479, 0.103400451,
    0.102661131, 0.101926495, 0.101196524, 0.100471196, 0.099750489,
    0.099034383, 0.098322857, 0.097615889, 0.096913457, 0.096215542,
    0.09552212,  0.094833172, 0.094148676, 0.09346861,  0.092792953,
    0.092121684, 0.091454782, 0.090792224, 0.09013399,  0.089480059,
    0.088830409, 0.088185019, 0.087543867, 0.086906933, 0.086274194,
    0.085645631, 0.08502122,  0.084400942, 0.083784774, 0.083172696,
    0.082564687, 0.081960725, 0.08136079,  0.080764859, 0.080172912,
    0.079584928, 0.079000886, 0.078420765, 0.077844544, 0.077272202,
    0.076703718, 0.076139071, 0.07557824,  0.075021205, 0.074467945,
    0.073918439, 0.073372666, 0.072830606, 0.072292238, 0.071757542,
    0.071226497, 0.070699083, 0.070175279, 0.069655065, 0.06913842,
    0.068625325, 0.068115759, 0.067609703, 0.067107135, 0.066608036,
    0.066112385, 0.065620164, 0.065131352, 0.06464593,  0.064163876,
    0.063685173, 0.0632098,   0.062737737, 0.062268966, 0.061803466,
    0.061341219, 0.060882204, 0.060426403, 0.059973797, 0.059524366,
    0.059078091, 0.058634954, 0.058194935, 0.057758015, 0.057324176,
    0.056893399, 0.056465665, 0.056040956, 0.055619253, 0.055200538,
    0.054784792, 0.054371997, 0.053962135, 0.053555187, 0.053151136,
    0.052749964, 0.052351652, 0.051956183, 0.051563538, 0.051173701,
    0.050786653, 0.050402377, 0.050020856, 0.049642071, 0.049266006,
    0.048892643, 0.048521966, 0.048153956, 0.047788598, 0.047425873,
    0.047065766, 0.046708258, 0.046353335, 0.046000978, 0.045651171,
    0.045303898, 0.044959142, 0.044616887, 0.044277117, 0.043939815,
    0.043604966, 0.043272553, 0.04294256,  0.042614972, 0.042289772,
    0.041966945, 0.041646475, 0.041328347, 0.041012545, 0.040699054,
    0.040387858, 0.040078942, 0.039772291, 0.039467889, 0.039165723,
    0.038865776, 0.038568034, 0.038272482, 0.037979106, 0.037687891,
    0.037398821, 0.037111883, 0.036827063, 0.036544345, 0.036263716,
    0.035985162, 0.035708668, 0.03543422,  0.035161805, 0.034891409,
    0.034623017, 0.034356616, 0.034092192, 0.033829733, 0.033569223,
    0.033310651, 0.033054002, 0.032799263, 0.032546422, 0.032295465,
    0.032046378, 0.03179915,  0.031553767, 0.031310216, 0.031068484,
    0.03082856,  0.030590429, 0.030354081, 0.030119502, 0.02988668,
    0.029655602, 0.029426257, 0.029198633, 0.028972716, 0.028748496,
    0.02852596,  0.028305096, 0.028085893, 0.027868339, 0.027652422,
    0.027438131, 0.027225454, 0.02701438,  0.026804897, 0.026596994,
    0.026390659, 0.026185883, 0.025982653, 0.025780958, 0.025580788,
    0.025382132, 0.025184979, 0.024989317, 0.024795137, 0.024602428,
    0.02441118,  0.024221381, 0.024033021, 0.02384609,  0.023660578,
    0.023476475, 0.02329377,  0.023112453, 0.022932514, 0.022753943,
    0.022576731, 0.022400868, 0.022226343, 0.022053147, 0.021881271,
    0.021710704, 0.021541438, 0.021373463, 0.021206769, 0.021041347,
    0.020877188, 0.020714283, 0.020552622, 0.020392196, 0.020232997,
    0.020075015, 0.019918242, 0.019762668, 0.019608285, 0.019455085,
    0.019303057, 0.019152195, 0.019002488, 0.018853929, 0.01870651,
    0.018560221, 0.018415055, 0.018271004, 0.018128058, 0.01798621,
    0.017845452, 0.017705775, 0.017567173, 0.017429636, 0.017293157,
    0.017157727, 0.017023341, 0.016889988, 0.016757663, 0.016626356,
    0.016496061, 0.016366771, 0.016238476, 0.016111171, 0.015984848,
    0.0158595,   0.015735118, 0.015611697, 0.015489228, 0.015367706,
    0.015247121, 0.015127469, 0.015008741, 0.014890931, 0.014774032,
    0.014658037, 0.014542939, 0.014428731, 0.014315408, 0.014202961,
    0.014091386, 0.013980674, 0.01387082,  0.013761817, 0.013653659,
    0.013546339, 0.013439852, 0.01333419,  0.013229347, 0.013125318,
    0.013022097, 0.012919676, 0.01281805,  0.012717214, 0.012617161,
    0.012517885, 0.01241938,  0.01232164,  0.012224661, 0.012128435,
    0.012032957, 0.011938222, 0.011844224, 0.011750958, 0.011658417,
    0.011566596, 0.01147549,  0.011385093, 0.0112954,   0.011206406,
    0.011118105, 0.011030493, 0.010943563, 0.01085731,  0.01077173,
    0.010686817, 0.010602567, 0.010518973, 0.010436032, 0.010353738,
    0.010272086, 0.010191071, 0.010110688, 0.010030934, 0.009951802,
    0.009873288, 0.009795387, 0.009718095, 0.009641407, 0.009565319,
    0.009489825, 0.009414921, 0.009340603, 0.009266866, 0.009193705,
    0.009121117, 0.009049097, 0.00897764,  0.008906743, 0.0088364,
    0.008766609, 0.008697363, 0.00862866,  0.008560494, 0.008492863,
    0.008425761, 0.008359185, 0.008293131, 0.008227594, 0.008162571,
    0.008098058, 0.00803405,  0.007970544, 0.007907537, 0.007845023,
    0.007783,    0.007721463, 0.007660409, 0.007599834, 0.007539735,
    0.007480107, 0.007420947, 0.007362251, 0.007304017, 0.00724624,
    0.007188916, 0.007132043, 0.007075616, 0.007019633, 0.006964089,
    0.006908982, 0.006854308, 0.006800064, 0.006746246, 0.006692851,
    0.006639876, 0.006587317, 0.006535172, 0.006483437, 0.006432108,
    0.006381184, 0.00633066,  0.006280534, 0.006230802, 0.006181461,
    0.006132509, 0.006083941, 0.006035757, 0.005987951, 0.005940522,
    0.005893467, 0.005846781, 0.005800464, 0.005754511, 0.005708921,
    0.005663689, 0.005618814, 0.005574292, 0.005530122, 0.005486299,
    0.005442822, 0.005399687, 0.005356892, 0.005314435, 0.005272312,
    0.005230522, 0.005189061, 0.005147927, 0.005107117, 0.005066629,
    0.005026461, 0.004986609, 0.004947072, 0.004907847, 0.004868931,
    0.004830323, 0.004792019, 0.004754017, 0.004716315, 0.004678911,
    0.004641802, 0.004604986, 0.004568461, 0.004532224, 0.004496273,
    0.004460606, 0.004425221, 0.004390115, 0.004355287, 0.004320734,
    0.004286453, 0.004252444, 0.004218703, 0.004185228, 0.004152019,
    0.004119071, 0.004086384, 0.004053956, 0.004021783, 0.003989865,
    0.003958199, 0.003926784, 0.003895617, 0.003864696, 0.00383402,
    0.003803587, 0.003773394, 0.003743439, 0.003713722, 0.00368424,
    0.003654991, 0.003625973, 0.003597185, 0.003568625, 0.00354029,
    0.00351218,  0.003484292, 0.003456625, 0.003429177, 0.003401946,
    0.00337493,  0.003348128, 0.003321539, 0.00329516,  0.00326899,
    0.003243026, 0.003217269, 0.003191715, 0.003166364, 0.003141213,
    0.003116262, 0.003091508, 0.00306695,  0.003042587, 0.003018416,
    0.002994437, 0.002970648, 0.002947048, 0.002923634, 0.002900406,
    0.002877362, 0.0028545,   0.00283182,  0.002809319, 0.002786996,
    0.002764851, 0.00274288,  0.002721084, 0.002699461, 0.002678009,
    0.002656727, 0.002635614, 0.002614668, 0.002593888, 0.002573273,
    0.002552821, 0.002532532, 0.002512403, 0.002492434, 0.002472623,
    0.002452969, 0.002433472, 0.002414128, 0.002394938, 0.002375901,
    0.002357014, 0.002338277, 0.002319688, 0.002301248, 0.002282953,
    0.002264803, 0.002246798, 0.002228935, 0.002211214, 0.002193633,
    0.002176192, 0.00215889,  0.002141724, 0.002124695, 0.002107801,
    0.002091041, 0.002074414, 0.002057919, 0.002041555, 0.00202532,
    0.002009215, 0.001993237, 0.001977386, 0.001961661, 0.001946061,
    0.001930585, 0.001915231, 0.001899999, 0.001884888, 0.001869898,
    0.001855026, 0.001840272, 0.001825635, 0.001811115, 0.00179671,
    0.001782419, 0.001768241, 0.001754177, 0.001740223, 0.001726381,
    0.001712649, 0.001699025, 0.00168551,  0.001672102, 0.001658801,
    0.001645605, 0.001632514, 0.001619527, 0.001606644, 0.001593862,
    0.001581182, 0.001568603, 0.001556124, 0.001543744, 0.001531462,
    0.001519277, 0.00150719,  0.001495198, 0.001483302, 0.001471501,
    0.001459793, 0.001448178, 0.001436655, 0.001425224, 0.001413884,
    0.001402634, 0.001391473, 0.001380401, 0.001369417, 0.00135852,
    0.00134771,  0.001336985, 0.001326346, 0.001315792, 0.001305321,
    0.001294934, 0.001284629, 0.001274406, 0.001264264, 0.001254203,
    0.001244222, 0.00123432,  0.001224497, 0.001214752, 0.001205084,
    0.001195493, 0.001185979, 0.00117654,  0.001167176, 0.001157887,
    0.001148671, 0.001139529, 0.001130459, 0.001121462, 0.001112536,
    0.001103681, 0.001094896, 0.001086182, 0.001077536, 0.00106896,
    0.001060451, 0.00105201,  0.001043636, 0.001035329, 0.001027088,
    0.001018912, 0.001010802, 0.001002756, 0.000994774, 0.000986855,
    0.000978999, 0.000971206, 0.000963475, 0.000955805, 0.000948197,
    0.000940648, 0.00093316,  0.000925732, 0.000918362, 0.000911051,
    0.000903798, 0.000896603, 0.000889465, 0.000882384, 0.00087536,
    0.000868391, 0.000861477, 0.000854619, 0.000847815, 0.000841065,
    0.000834369, 0.000827726, 0.000821136, 0.000814599, 0.000808113,
    0.000801679, 0.000795296, 0.000788964, 0.000782683, 0.000776451,
    0.000770269, 0.000764136, 0.000758052, 0.000752016, 0.000746029,
    0.000740089, 0.000734196, 0.00072835,  0.000722551, 0.000716798,
    0.00071109,  0.000705428, 0.000699811, 0.000694239, 0.000688711,
    0.000683227, 0.000677787, 0.00067239,  0.000667036, 0.000661724,
    0.000656455, 0.000651228, 0.000646042, 0.000640897, 0.000635794,
    0.000630731, 0.000625709, 0.000620726, 0.000615783, 0.000610879,
    0.000606015, 0.000601189, 0.000596401, 0.000591652, 0.00058694,
    0.000582266, 0.00057763,  0.00057303,  0.000568466, 0.000563939,
    0.000559448, 0.000554993, 0.000550573, 0.000546189, 0.000541839,
    0.000537524, 0.000533243, 0.000528996, 0.000524783, 0.000520604,
    0.000516458, 0.000512345, 0.000508265, 0.000504217, 0.000500201,
    0.000496217, 0.000492265, 0.000488345, 0.000484456, 0.000480597,
    0.00047677,  0.000472973, 0.000469206, 0.000465469, 0.000461762,
    0.000458084, 0.000454436, 0.000450816, 0.000447226, 0.000443664,
    0.00044013,  0.000436625, 0.000433147, 0.000429697, 0.000426275,
    0.00042288,  0.000419512, 0.00041617,  0.000412855, 0.000409567,
    0.000406305, 0.000403069, 0.000399858, 0.000396674, 0.000393514,
    0.00039038,  0.00038727,  0.000384186, 0.000381126, 0.00037809,
    0.000375079, 0.000372091, 0.000369127, 0.000366187, 0.00036327,
    0.000360377, 0.000357506, 0.000354659, 0.000351834, 0.000349031,
    0.000346251, 0.000343493, 0.000340757, 0.000338043, 0.00033535};

static bool check_input_int8_range(float input)
{
  bool ret = input > -128.0 && input < 128.0;
  if (!ret) {
    printf("invalid int8 range, input is %f\n", input);
  }
  return ret;
}

static double _gen_sigmoid(float x)
{
  return 1.0 / (1.0 + exp(-(x)));
}

static void tl_lut_ref(u16 *ofmap, u16 *ifmap, u16 *table, u16 *table_slope,
                       tl_shape_t ifmap_shape, tl_shape_t table_shape,
                       int range_start, int range_end)
{
  int tn, th, tw;

  tn = table_shape.n;
  th = table_shape.h;
  tw = table_shape.w;
  assert(tn == 1);
  assert(th * tw == 256);
  assert(table);
  assert(table_slope);
  assert(ifmap_shape.n);
  assert(ifmap);
  assert(ofmap);

  // TODO: use c function
  // 1. dump all input as binary file
#ifdef GDB
#define INFP32FILE "infp32file.bin"
#define OUTBF16FILE "lutbf16out.bin"
  FILE *pFile;
  pFile = fopen(INFP32FILE, "wb");
  int shape_sz = tl_shape_size(&ifmap_shape);
  float *f = (float *)malloc(sizeof(float) * shape_sz];
  for (int i = 0; i < shape_sz; i++) {
    f[i] = convert_bf16_fp32(ifmap[i]);
  }
  fwrite(f, 1, shape_sz * sizeof(float), pFile);
  fclose(pFile);

  // 2. read result from `eval_lut.py`
  char command[256];
  sprintf(command,
          "python eval_lut.py --lut_input_range_start %d --lut_input_range_end "
          "%d --inputfloat32 %s --outputbf16 %s 2>&1 > 2\n",
          range_start, range_end, INFP32FILE, OUTBF16FILE);

  int r;
  r = system(command);
  printf("command is %s, return %d\n", command, r);
  assert(r != 0);

  pFile = fopen(OUTBF16FILE, "rb");
  if (!pFile) {
    fprintf(stderr, "open golden %s fail\n", OUTBF16FILE);
    exit(-1);
  }

  size_t file_length;
  file_length = fread(ofmap, sizeof(u16), tl_shape_size(&ifmap_shape), pFile);
  printf("read from golden, file size %" PRIu64 "\n", file_length);
  fclose(pFile);
#else
  assert(range_start);
  assert(range_end);
  for (u64 i = 0; i < tl_shape_size(&ifmap_shape); i++) {
    ofmap[i] = convert_fp32_bf16(_gen_sigmoid(convert_bf16_fp32(ifmap[i])));
  }
#endif

#ifdef GDB
  for (u64 i = 0; i < tl_shape_size(&ifmap_shape); i++) {
    printf("ref %" PRIu64 " input 0x%x(%f) golden 0x%x(%f)\n", i, ifmap[i],
           convert_bf16_fp32(ifmap[i]), ofmap[i], convert_bf16_fp32(ofmap[i]));
  }
#endif
}

static bool verify(u16 *ofmap_data, u16 *ref_data, u64 ofmap_size)
{
  int count = 0;
  u64 size = ofmap_size;
  if (mode == PRE_DATA_COMPARE_FIX) {
    size = sizeof(sigmode_golden_bf16) / sizeof(u16);
  } else if (PRE_DATA_MAX_ERROR) {
    size = sizeof(sigmode_golden) / sizeof(double);
  }

  for (u64 i = 0; i < size; i++) {
    if (mode == PRE_DATA_COMPARE_FIX) {
      if (ofmap_data[i] != sigmode_golden_bf16[i]) {
        fprintf(stderr,
                "[%d] comparing failed at ofmap_data[%" PRIu64 "], got %x, exp %x\n",
                count, i, ofmap_data[i], sigmode_golden_bf16[i]);
        exit(-1);
      }
    } else {
      float got = convert_bf16_fp32(ofmap_data[i]);
      float exp = convert_bf16_fp32(ref_data[i]);

      if (mode == PRE_DATA_MAX_ERROR) {
        // cus we have better accuracy ~ 0.0039
        exp = sigmode_golden[i];
      }

      if (fabs(got - exp) > MAX_ERROR) {
        fprintf(stderr,
                "[%d] comparing failed at ofmap_data[%" PRIu64 "], got %x, exp %x, "
                "diff(%f - %f) is %f\n",
                count, i, ofmap_data[i], ref_data[i], got, exp,
                fabs(got - exp));
        count++;
      }
    }
  }

  if (count != 0) {
    printf("error count is %d\n", count);
    exit(-1);
  }

  return true;
}

static void gen_input(u16 *ifmap, u64 ifmap_size)
{
  if (mode == PRE_DATA_COMPARE_FIX || mode == PRE_DATA_MAX_ERROR) {
    // ifmap_size 2048, pattern_size 2000
    memset(ifmap, 0, sizeof(u16) * ifmap_size);
    memcpy(ifmap, &test_pattern, sizeof(test_pattern));

#ifdef GDB
    for (u64 i = 0; i < ifmap_size; i++) {
      printf("source if[%" PRIu64 "] is bf16 %f (bf16)with 0x%x\n", i,
             convert_bf16_fp32(ifmap[i]), ifmap[i]);
    }
#endif
  } else {
    int table_hw = 256;
    for (u64 i = 0; i < ifmap_size; i++) {
      // input range is -8 ~ +8
      float input = ((int)i % 7) * (((int)i % 2) ? 1 : -1) + 0.03 +
                    (i % table_hw) * 0.002;
      // float input = ((int)i % 10) * (((int)i % 2) ? 1 : -1) + 0.03 + (i %
      // table_hw) * 0.002;
      assert(check_input_int8_range(input));
      ifmap[i] = convert_fp32_bf16(input);
#ifdef GDB
      printf("source if[%" PRIu64 "] is bf16 %f, input is %f (bf16)with 0x%x\n", i,
             convert_bf16_fp32(ifmap[i]), input, ifmap[i]);
#endif
    }
  }
}

static void testbench(CVI_RT_HANDLE *ctx, bmk_ctx_t *bmk)
{
  // TODO: check more shape / align
  tl_shape_t ifmap_shape;
  if (mode == PRE_DATA_COMPARE_FIX || mode == PRE_DATA_MAX_ERROR) {
    ifmap_shape = {1, 32, 8, 8};
  } else {
    ifmap_shape = {1, 32, 16, 16};
  }

  fmt_t fmt = FMT_BF16;

  // get table / input shape
  tl_shape_t table_shape;
  bf16_table_shape(bmk, &table_shape);
  tl_shape_t ofmap_shape = ifmap_shape;

  u64 ifmap_size = tl_shape_size(&ifmap_shape);
  u64 table_size = tl_shape_size(&table_shape);
  u64 ofmap_size = tl_shape_size(&ofmap_shape);

  int data_type_size = bytesize_of_fmt(fmt);
  u64 ifmap_bytesize = ifmap_size * data_type_size;
  u64 table_bytesize = table_size * data_type_size;
  u64 ofmap_bytesize = ofmap_size * data_type_size;

  // alloc tg
  u16 *ifmap = (u16 *)xmalloc(ifmap_bytesize);
  u16 *table_data = (u16 *)xmalloc(table_bytesize);
  u16 *table_data_slope = (u16 *)xmalloc(table_bytesize);
  u16 *ref_data = (u16 *)xmalloc(ofmap_bytesize);

  memset(table_data, 0, table_bytesize);
  memset(table_data_slope, 0, table_bytesize);

  // range depend on ur activation
  int range_start = -8;
  int range_end = 8;
  float scale = bf16_sigmoid_scale(range_start, range_end);

  // fill tg value
  gen_input(ifmap, ifmap_size);
  bf16_sigmoid_tbl(table_data, table_data_slope, &table_shape, range_start,
                   range_end);
  tl_lut_ref(ref_data, ifmap, table_data, table_data_slope, ifmap_shape,
             table_shape, range_start, range_end);

  // alloc tl
  tl_t *tl_ifmap = alloc_tl(bmk, ifmap_shape, fmt, /*align*/1);
  tl_t *tl_table_answer = alloc_tl(bmk, table_shape, fmt, /*align*/1);
  tl_t *tl_table_answer_slope = alloc_tl(bmk, table_shape, fmt, /*align*/1);
  tl_t *tl_buf = alloc_tl(bmk, ofmap_shape, fmt, /*align*/1);
  tl_t *tl_ofmap_bf16 = alloc_tl(bmk, ofmap_shape, fmt, /*align*/1);

  // sys->local
  put_bf16_tensor_g2l(ctx, bmk, tl_ifmap, (u16 *)ifmap, FMT_BF16);
  put_bf16_tensor_g2l(ctx, bmk, tl_table_answer, (u16 *)table_data, FMT_BF16);
  put_bf16_tensor_g2l(ctx, bmk, tl_table_answer_slope, (u16 *)table_data_slope,
                      FMT_BF16);

  // emit core function
  bf16_emit_sigmoid(bmk, tl_ifmap, tl_buf, tl_table_answer,
                    tl_table_answer_slope, tl_ofmap_bf16, scale);


  u16 *ofmap_data = (u16 *)get_bf16_tensor_l2g(ctx, bmk, tl_ofmap_bf16, fmt);

  verify(ofmap_data, ref_data, ofmap_size);

  free_tl(bmk, tl_ofmap_bf16);
  free_tl(bmk, tl_buf);
  free_tl(bmk, tl_table_answer_slope);
  free_tl(bmk, tl_table_answer);
  free_tl(bmk, tl_ifmap);

  free(ifmap);
  free(table_data);
  free(table_data_slope);
  free(ref_data);
  free(ofmap_data);
}

int main()
{
  CVI_RT_HANDLE ctx;
  bmk_ctx_t *bmk;
  int round_mode;

  round_mode = set_store_feround();

  test_init(&ctx, &bmk);

  for (int i = PRE_DATA_COMPARE_FIX; i < TEST_MODE_MAX; i++) {
    // for (int i = GEN_DATA_MAX_ERROR; i < TEST_MODE_MAX; i++) {
    // for (int i = PRE_DATA_MAX_ERROR; i < GEN_DATA_MAX_ERROR; i++) {
    mode = static_cast<TEST_MODE>(i);
    printf("test mode %d...\n", mode);
    testbench(&ctx, bmk);
  }

  test_exit(&ctx);
  restore_feround(round_mode);
  return 0;
}
